package stkr;

import java.io.IOException;

public class StockThread implements Runnable {

	Stock stock;
	int stockTickerInterval; 

	public StockThread(Stock stock,int stockTickerInterval) {
		super();
		this.stock = stock;
		this.stockTickerInterval=stockTickerInterval;
	}

	@Override
	public void run() {

		while(true){
		
		try {
			stock.updateStock();
		} catch (IOException e) {
			e.printStackTrace();
		}
		try {
			Thread.sleep(stockTickerInterval*1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		}
		

	}

}
